package com.ipfsemc.ipfsemc.quartz;

import com.ipfsemc.ipfsemc.mapper.UserSpaceMapper;
import com.ipfsemc.ipfsemc.model.Order;
import com.ipfsemc.ipfsemc.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 每天凌晨查看用户矿机或者服务费是否到期
 */
@Slf4j
@Component
public class CheckMillJob implements Job {

    @Autowired
    private UserSpaceMapper userSpaceMapper;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("CheckMillJob【检查矿机是否过期】" + new Date().toLocaleString());

        userSpaceMapper.checkMill();
//        userSpaceMapper.checkMillTwo();//不用
    }

}
